package com.yisa.kuang.mapper;

import com.github.pagehelper.Page;
import com.yisa.kuang.pojo.grade;
import com.yisa.kuang.pojo.kuang;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.mybatis.spring.annotation.MapperScan;

import java.util.List;


public interface StudentMapper {

   // @Select("select * from students")
    List<kuang> setAllStudent();

    //@Insert("INSERT INTO `student`.`students`(`id`, `name`, `sex`, `gradeId`) VALUES (null, #{name}, #{sex}, #{gradeId})")
    int addStudent(kuang kuan);

    @Delete("delete from students where id = #{id}")
    int detStudent(Integer id);

    @Update("UPDATE `student`.`students` SET `name` = #{name}, `sex` = #{sex}, `gradeId` = #{gradeId} WHERE `id` = #{id}")
    int updateStudent(kuang kuan);

    @Select("select * from students where id = #{id}")
    kuang findStudent(Integer id);

    List<kuang> findStudengmr(kuang kuan);

}
